﻿using System;
using System.Web.SessionState;
using System.Data;
namespace SE560Multimedia.src
{
    public sealed class SessionManager
    {
        public static String LOGIN_PAGE_ADDRESS = "LoginPage.aspx";
        public static String USER_PREFERENCES_PAGE_ADDESS = "UserPreferencesPage.aspx";
        public static String PLAY_PAGE_ADDESS = "PlayPage.aspx";
        private HttpSessionState Session;

        public SessionManager( HttpSessionState Session )
        {
            this.Session = Session;
        }

        public int SessionLoggedUserId
        {
            get { return (int)Session["loggeduserid"]; }
            set { Session["loggeduserid"] = value; }
        }

        public String SessionLoggedUserName
        {
            get { return (String)Session["loggedusername"]; }
            set { Session["loggedusername"] = value; }
        }

        public int SessionLoggedPlaylistID
        {
            get { return (int)Session["loggeduserplaylistid"]; }
            set { Session["loggeduserplaylistid"] = value; }
        }

        public int PlayingMediaID
        {
            get { return Convert.ToInt32(CurrentDataRow["MEDIA_ID"]); }
        }       

        public String PlayingMediaName
        {
            get { return (String)CurrentDataRow["MEDIA_FILE_NAME"]; }
        }       

        public String PlayingMediaArtistName
        {
            get { return (String)CurrentDataRow["MEDIA_ARTIST_NAME"]; }
        }

        public System.String PlayingMediaAlbumName
        {
            get { return (String)CurrentDataRow["MEDIA_ALBUM_NAME"]; }
        }

        public System.Data.DataRow CurrentDataRow
        {
            get { return (System.Data.DataRow)Session["selectedmedia"]; }
            set { Session["selectedmedia"] = value; }
        }

        public ProjectDataSet.mediaDataTable PlaylistResult
        {
            get{ return (ProjectDataSet.mediaDataTable)Session["searchDataTable"]; }
            set{ Session["searchDataTable"] = value; }
        }
    }
}